#ifndef _EXPLOSION_H_
#define _EXPLOSION_H_

#include <windows.h>
#include <xnamath.h>
#include <vector>
#include "Billboard.h"

#define EXPLOSION_SMOKE_COUNT 1000
#define EXPLOSION_BURST_COUNT 15

struct ExplosionSmoke
{
	XMFLOAT3 position;
	XMFLOAT3 velocity;
	float size;
	float distance;
};

struct ExplosionBurst
{
	XMFLOAT3 position;
	XMFLOAT3 velocity;
};

class Explosion
{
public:
	Explosion();
	Explosion(const Explosion&);
	~Explosion();

	void Initialize();
	void Update(int pElapsedTime);
	void StartExplosion(XMFLOAT3 pPosition, XMFLOAT3 pNormal);
	void Render();
protected:
	Billboard* mBillboardFlame;
	Billboard* mBillboardSmoke;
	bool mIsActive;
	ExplosionSmoke mSmokes[EXPLOSION_SMOKE_COUNT];
	ExplosionSmoke mBursts[EXPLOSION_BURST_COUNT];
	VertexTypeBillboard mVerticesSmokes[EXPLOSION_SMOKE_COUNT];
	VertexTypeBillboard mVerticesFlames[1];

	int mLifeTime;
	int mSmokeCount;
};
#endif // _EXPLOSION_H_
